using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using IdentityServer4.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Yozeev.SystemConfig;
using Yozeev.UserManagerment.Users;

namespace Yozeev.BusinessLogic
{
    /// <summary>
    /// 账单
    /// </summary>
    public class Account: ByBranchEntity<Guid>
    {
        /// <summary>
        /// 结账单号
        /// </summary>
        [Required(ErrorMessage = "结账单号不能为空")]
        public string AccountNo { get; set; }
        /// <summary>
        /// 结账日期
        /// </summary>
        [Required(ErrorMessage = "结账日期不能为空")]
        public DateTime AccountDate { get; set; }
        /// <summary>
        /// 应收数量
        /// </summary>
        [Required(ErrorMessage = "数量不能为空")]
        public long Quantity { get; set; }
        /// <summary>
        /// 应收金额
        /// </summary>
        [Required(ErrorMessage = "金额不能为空")]
        public decimal Amount { get; set; }
        /// <summary>
        /// 收款状态
        /// </summary>
        public AccountStatusEnum AccountStatus { get; set; }
        /// <summary>
        /// 收款人标识
        /// </summary>
        public long? CollectiorId { get; set; }
        [ForeignKey("CollectiorId")]
        public virtual User Collectior { get; set; }
        /// <summary>
        /// 收款时间
        /// </summary>
        public DateTime? CollectionTime { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public Guid? PayMethodId { get; set; }
        [ForeignKey("PayMethodId")]
        public PayMethod PayMethod { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 流水号，包括银行名称，银行账号，流水号
        /// </summary>
        public string VoucherNo { get; set; }
        /// <summary>
        /// 应退金额
        /// </summary>
        public decimal RAmount { get; set; }
        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }
        /// <summary>
        /// 应退数量
        /// </summary>
        public long RQuantity { get; set; }
        /// <summary>
        /// 总数量
        /// </summary>
        public long TotalQuantity { get; set; }

    }
}
